import agentHttp from '@/utils/agentHttp'    //请求方法
import dialogForm from './edit'
import pagination from '@/views/pagination'  //分页组件
export default {
  name: 'addLogisticsInfo',
  components:{dialogForm,pagination},
  created(){
      this.seachData();
      this.allButton = buttonPermission('all');
      this.addButton= buttonPermission('add');
  },
  data() {
  	return {
      //搜索字段
  		searchForm:{},
      //表格字段
      tableData: [{}],
      //弹窗状态数据
      dialogSendData:{
        isAdd:"",
        dialogFormVisible:"",
        id:""
      },
      formLabelWidth:'120px',
      carOrderStatusMap:''
  	}
  },

  methods: {
    seachData(){
      var params=this.searchForm||{};
      params.page=this.tableData.page||1;
      params.rows=this.tableData.rows||10;
      agentHttp.post('adminApi/admin/logistics_info_add/list',params ).then((data)=>{
        if (data.success) {
            this.tableData = data.data.tableData;
            this.carOrderStatusMap = data.data.carOrderStatusMap;
          }
      })
    },
    //新增、编辑
    handleEdit(index, row){
      row?this.dialogSendData.id=row.id:this.dialogSendData.id="";
      this.dialogSendData.isAdd=true;
      this.dialogSendData.dialogFormVisible=true;
    }
  }
}
